
   <html>
   <head>
   <style type=text/css>
   body { font-size: 10pt; font-family: Arial; }
   </style>
   </head>
   <body>
   
</br>
<font color="darkred">#include</font>&lt;stdio.h&gt;</br>
<font color="darkred">#include</font>&lt;coelacanth/queue.h&gt;</br>
</br>
void&nbsp;testfunc(void&nbsp;*q)</br>
{</br>
&nbsp;&nbsp;&nbsp;queue_ptr(tmp,&nbsp;<font color="darkgreen">int</font>);</br>
&nbsp;&nbsp;&nbsp;tmp&nbsp;=&nbsp;q;</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(tmp,&nbsp;3);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(tmp));</br>
}</br>
</br>
<font color="darkgreen">int</font>&nbsp;main()</br>
{</br>
&nbsp;&nbsp;&nbsp;queue(queue,&nbsp;<font color="darkgreen">int</font>);</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(queue,&nbsp;2);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;testfunc(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(queue,&nbsp;5);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(queue,&nbsp;7);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(queue,&nbsp;11);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;queue_enqueue(queue,&nbsp;13);</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("enqueue:&nbsp;%d\n",&nbsp;queue_get_tail(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("size:&nbsp;%ld\n",&nbsp;queue_size(queue));</br>
</br>
&nbsp;&nbsp;&nbsp;pr<font color="darkgreen">int</font>f("dequeue:&nbsp;%d\n",&nbsp;queue_get_head(queue));</br>
&nbsp;&nbsp;&nbsp;queue_dequeue(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;puts("destroying");</br>
&nbsp;&nbsp;&nbsp;queue_free(queue);</br>
</br>
&nbsp;&nbsp;&nbsp;<font color="#6d4d00">return</font>&nbsp;0;</br>
}</br>
</br>
</br>
</br>
</br>
</body></html>
